package Test;
import MyArrayList.MyArrayList;

public class TestMyArrayList extends Test{
    public  void test() {
        MyArrayList<Integer> list1 = new MyArrayList<Integer>();
        System.out.println("empty: " + list1.isEmpty());
        System.out.println("full: " + list1.isFull());
        for(int i = 0; i < 5; i++) {
            list1.addFirst(i);
        }
        list1.disPlay();
        list1.clear();
        System.out.println(list1.isEmpty());
        for(int i = 0; i < 5; i++) {
            list1.add(i);
        }
        list1.disPlay();
        list1.pop(2);
        list1.remove(1);
        System.out.println(list1);
        list1.clear();
        for(int i = 0; i < 5; i++) {
            list1.add(i%2);
        }
        list1.disPlay();
        list1.removeAll(0);
        //list1.removeAll(1);
        list1.disPlay();
        System.out.println("size = " + list1.size());
        list1.clear();
        /*int i = 0;
        while(list1.add(i++));
        list1.disPlay();*/
        System.out.println("full: " + list1.isFull());
        System.out.println("size = " + list1.size());
        list1.clear();
        System.out.println("----------------------");
        for(int j = 0; j < 20; j++) {
            list1.add(j);
        }
        System.out.println(list1);
        System.out.println(list1.get(5));
        list1.set(666, 5);
        System.out.println(list1.get(5));
    }

    public TestMyArrayList(int num) {
        super(num);
    }
    public TestMyArrayList() {
    }
    @Override
    public String toString() {
        return "TestMyArrayList: " + super.num;
    }

}
